#include <iostream>
#include <string>

using namespace std;

class A
{
    private:
    int a = 0;
    string  b = "str";
    public:
    A(): a(5) {}        // 构造函数会在类内初始化之后进行，所以a的值会变成5
    void print()
    {
        cout<<"a="<<a<<endl;
        cout<<"b="<<b<<endl;
    }
};

int main()
{
    A a;
    a.print();
}